home *** CD-ROM | disk | FTP | other *** search
/ ASME's Mechanical Engine…ing Toolkit 1997 December / ASME's Mechanical Engineering Toolkit 1997 December.iso / basic / bas2sb.lzh / BAS2SB.TXT < prev    next >
Text File  |  1988-01-19  |  5KB  |  137 lines

  1.  
  2.      
  3.      
  4.      
  5.      
  6.      
  7.      
  8.      
  9.      
  10.      
  11.      
  12.      
  13.      
  14.                     BAS2SB - BASIC to Structured BASIC Converter
  15.      
  16.                                   (c)opyright 1988
  17.      
  18.                            International No-Bugs Software
  19.      
  20.                                 Program Information
  21.         
  22.      
  23.      
  24.                                     INTRODUCTION
  25.      
  26.      
  27.               BAS2SB  automates many of the source code  re-formatting 
  28.               procedures  commonly performed when switching over  from 
  29.               BASICA  or  GW-BASIC  to the  new  generation  of  BASIC 
  30.               compilers (such as Turbo BASIC or QuickBASIC).
  31.      
  32.      
  33.               BAS2SB programs become much more comprehensible,  and as 
  34.               a  result,  much  simpler  to  convert  into  structured 
  35.               formats.   This will allow you to take full advantage of 
  36.               QuickBASIC or Turbo BASIC.
  37.      
  38.      
  39.               BAS2SB  uses a BASIC source code file (ASCII format)  as 
  40.               its  standard  input,  and  returns  a  newly  formatted 
  41.               program that includes:
  42.      
  43.                  1)     One statement per program line          
  44.                  2)     IF, THEN, ELSE Nested Indentation
  45.                  3)     END IF blocked structures
  46.                  4)     Removal of non-targeted line numbers
  47.                  5)     Replacement  of  targeted lines  with  either 
  48.                         program generated, or user-supplied labels
  49.      
  50.      
  51.      
  52.                                         NOTE
  53.      
  54.      
  55.               Don't expect to recognize your new programs immediately. 
  56.               BAS2SB  does  NOT alter variables or  actual  code,  but 
  57.               linear programs with meaningful line labels take time to 
  58.               adjust  to.   It is highly advisable to have a hard copy 
  59.               of  the  original (numbered) source code at  hand  while 
  60.               adding  mneumonic labels.  Each target line can then  be 
  61.               respresented  by  the function it  performs.   You  will 
  62.               probably  find  this approach is worth the  extra  time, 
  63.               since it must be performed only once.
  64.      
  65.         
  66.      
  67.      
  68.      
  69.                                     USING BAS2SB
  70.      
  71.      
  72.               BAS2SB  needs very little assistance in converting BASIC 
  73.               programs. Listed below are the only requirements:
  74.      
  75.                  1)  Program must be in ASCII format (save with ",A").
  76.                  2)  Program lines must NOT contain any line-feeds or
  77.                      other control characters. 
  78.                  3)  Program lines must not exceed 255 characters.
  79.                  4)  Program source file must have a .BAS extension.
  80.      
  81.      
  82.               BAS2SB   does  NOT  alter  the  original  source   file.  
  83.               Instead, another file with the extension .SBX is created 
  84.               that will run under QuickBASIC and Turbo BASIC.
  85.      
  86.      
  87.      
  88.      
  89.                                  OPERATIONAL NOTES
  90.      
  91.      
  92.               When  invoking  BAS2SB,  you  will  be  prompted  for  a 
  93.               filename.   Do  NOT include an extension - the only  one 
  94.               allowed is the default, .BAS.
  95.      
  96.               If  the  source file is located,  BAS2SB will  begin  to 
  97.               reformat  the  source  file  by  looking  at  each  line 
  98.               individually  and will present each target  line  number 
  99.               and a prompt for an optional label.
  100.      
  101.               When prompted, you may choose to:
  102.                  
  103.                  1)  Enter a line label (up to 20 Characters).
  104.      
  105.                  2)  Enter a RETURN. (BAS2SB will provide the label).
  106.      
  107.                  3)  Enter a period.  From that point forward,  BAS2SB 
  108.                      will provide target labels.
  109.      
  110.               The number listed on the LEFT side of the display is the 
  111.               source line number being examined.
  112.      
  113.               The  number (if any) on the RIGHT side of the display is 
  114.               the target line number that was found in a corresponding 
  115.               GOTO,  GOSUB,  THEN,  ELSE, etc.  Once a target has been 
  116.               labeled,  further  references  to  that target  will  be 
  117.               automatically replaced without user intervention.
  118.         
  119.      
  120.      
  121.      
  122.                                    ERROR TRAPPING
  123.      
  124.      
  125.               In  the case of ERL references,  BAS2SB will retain  the 
  126.               original  line number references in the newly  generated 
  127.               source  file.   This allows proper trapping through  the 
  128.               use of the IF ERL construct.
  129.      
  130.      
  131.                                     FINAL NOTE
  132.      
  133.               BAS2SB  performs no error checking.   Any BASIC  program 
  134.               that compiles correctly BEFORE conversion should compile 
  135.               correctly  AFTER  conversion.    BAS2SB  will  not   fix 
  136.               programs that do not run.
  137.